using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._NetworkAnalystTools._Analysis
{
    /// <summary>
    /// <para>Add Field To Analysis Layer</para>
    /// <para>Adds a field to a sublayer of a network analysis layer.</para>
    /// <para>将字段添加到网络分析图层的子图层。</para>
    /// </summary>    
    [DisplayName("Add Field To Analysis Layer")]
    public class AddFieldToAnalysisLayer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddFieldToAnalysisLayer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_network_analysis_layer">
        /// <para>Input Network Analysis Layer</para>
        /// <para>The network analysis layer to which the new field will be added.</para>
        /// <para>将添加新字段的网络分析图层。</para>
        /// </param>
        /// <param name="_sub_layer">
        /// <para>Sub Layer</para>
        /// <para>The sublayer of the network analysis layer to which the new field will be added.</para>
        /// <para>将添加新字段的网络分析图层的子图层。</para>
        /// </param>
        /// <param name="_field_name">
        /// <para>Field Name</para>
        /// <para>The name of the field that will be added to the specified sublayer of the network analysis layer.</para>
        /// <para>将添加到网络分析图层的指定子图层的字段的名称。</para>
        /// </param>
        /// <param name="_field_type">
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the field type that will be used in the creation of the new field.</para>
        ///   <bulletList>
        ///     <bullet_item>Long (large integer)— Whole numbers between -2,147,483,648 and 2,147,483,647.</bullet_item><para/>
        ///     <bullet_item>Text—Any string of characters.</bullet_item><para/>
        ///     <bullet_item>Float (single precision)— Fractional numbers between -3.4E38 and 1.2E38.</bullet_item><para/>
        ///     <bullet_item>Double (double precision)— Fractional numbers between -2.2E308 and 1.8E308.</bullet_item><para/>
        ///     <bullet_item>Short (small integer)— Whole numbers between -32,768 and 32,767.</bullet_item><para/>
        ///     <bullet_item>Date—Date and/or time.</bullet_item><para/>
        ///     <bullet_item>Blob (binary data)—Long sequence of binary numbers. You need a custom loader or viewer or a third-party application to load items into a BLOB field or view the contents of a BLOB field.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将在创建新字段时使用的字段类型。</para>
        ///   <bulletList>
        ///     <bullet_item>长整数（大整数）— 介于 -2,147,483,648 和 2,147,483,647 之间的整数。</bullet_item><para/>
        ///     <bullet_item>文本 - 任意字符串。</bullet_item><para/>
        ///     <bullet_item>浮点数（单精度）— 介于 -3.4E38 和 1.2E38 之间的小数。</bullet_item><para/>
        ///     <bullet_item>双精度（双精度）— 介于 -2.2E308 和 1.8E308 之间的小数。</bullet_item><para/>
        ///     <bullet_item>短（小整数）— -32,768 和 32,767 之间的整数。</bullet_item><para/>
        ///     <bullet_item>日期 - 日期和/或时间。</bullet_item><para/>
        ///     <bullet_item>Blob（二进制数据）- 二进制数的长序列。您需要自定义加载程序或查看器或第三方应用程序才能将项目加载到 BLOB 字段或查看 BLOB 字段的内容。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public AddFieldToAnalysisLayer(object _in_network_analysis_layer, object _sub_layer, object _field_name, _field_type_value _field_type)
        {
            this._in_network_analysis_layer = _in_network_analysis_layer;
            this._sub_layer = _sub_layer;
            this._field_name = _field_name;
            this._field_type = _field_type;
        }
        public override string ToolboxName => "Network Analyst Tools";

        public override string ToolName => "Add Field To Analysis Layer";

        public override string CallName => "na.AddFieldToAnalysisLayer";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_network_analysis_layer, _sub_layer, _field_name, _field_type.GetGPValue(), _field_precision, _field_scale, _field_length, _field_alias, _field_is_nullable.GetGPValue(), _output_layer];

        /// <summary>
        /// <para>Input Network Analysis Layer</para>
        /// <para>The network analysis layer to which the new field will be added.</para>
        /// <para>将添加新字段的网络分析图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Network Analysis Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_network_analysis_layer { get; set; }


        /// <summary>
        /// <para>Sub Layer</para>
        /// <para>The sublayer of the network analysis layer to which the new field will be added.</para>
        /// <para>将添加新字段的网络分析图层的子图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sub Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sub_layer { get; set; }


        /// <summary>
        /// <para>Field Name</para>
        /// <para>The name of the field that will be added to the specified sublayer of the network analysis layer.</para>
        /// <para>将添加到网络分析图层的指定子图层的字段的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field_name { get; set; }


        /// <summary>
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the field type that will be used in the creation of the new field.</para>
        ///   <bulletList>
        ///     <bullet_item>Long (large integer)— Whole numbers between -2,147,483,648 and 2,147,483,647.</bullet_item><para/>
        ///     <bullet_item>Text—Any string of characters.</bullet_item><para/>
        ///     <bullet_item>Float (single precision)— Fractional numbers between -3.4E38 and 1.2E38.</bullet_item><para/>
        ///     <bullet_item>Double (double precision)— Fractional numbers between -2.2E308 and 1.8E308.</bullet_item><para/>
        ///     <bullet_item>Short (small integer)— Whole numbers between -32,768 and 32,767.</bullet_item><para/>
        ///     <bullet_item>Date—Date and/or time.</bullet_item><para/>
        ///     <bullet_item>Blob (binary data)—Long sequence of binary numbers. You need a custom loader or viewer or a third-party application to load items into a BLOB field or view the contents of a BLOB field.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将在创建新字段时使用的字段类型。</para>
        ///   <bulletList>
        ///     <bullet_item>长整数（大整数）— 介于 -2,147,483,648 和 2,147,483,647 之间的整数。</bullet_item><para/>
        ///     <bullet_item>文本 - 任意字符串。</bullet_item><para/>
        ///     <bullet_item>浮点数（单精度）— 介于 -3.4E38 和 1.2E38 之间的小数。</bullet_item><para/>
        ///     <bullet_item>双精度（双精度）— 介于 -2.2E308 和 1.8E308 之间的小数。</bullet_item><para/>
        ///     <bullet_item>短（小整数）— -32,768 和 32,767 之间的整数。</bullet_item><para/>
        ///     <bullet_item>日期 - 日期和/或时间。</bullet_item><para/>
        ///     <bullet_item>Blob（二进制数据）- 二进制数的长序列。您需要自定义加载程序或查看器或第三方应用程序才能将项目加载到 BLOB 字段或查看 BLOB 字段的内容。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _field_type_value _field_type { get; set; }

        public enum _field_type_value
        {
            /// <summary>
            /// <para>Text</para>
            /// <para>Text—Any string of characters.</para>
            /// <para>文本 - 任意字符串。</para>
            /// </summary>
            [Description("Text")]
            [GPEnumValue("TEXT")]
            _TEXT,

            /// <summary>
            /// <para>Float (single precision)</para>
            /// <para>Float (single precision)— Fractional numbers between -3.4E38 and 1.2E38.</para>
            /// <para>浮点数（单精度）— 介于 -3.4E38 和 1.2E38 之间的小数。</para>
            /// </summary>
            [Description("Float (single precision)")]
            [GPEnumValue("FLOAT")]
            _FLOAT,

            /// <summary>
            /// <para>Double  (double precision)</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Double  (double precision)")]
            [GPEnumValue("DOUBLE")]
            _DOUBLE,

            /// <summary>
            /// <para>Short (small integer)</para>
            /// <para>Short (small integer)— Whole numbers between -32,768 and 32,767.</para>
            /// <para>短（小整数）— -32,768 和 32,767 之间的整数。</para>
            /// </summary>
            [Description("Short (small integer)")]
            [GPEnumValue("SHORT")]
            _SHORT,

            /// <summary>
            /// <para>Long (large integer)</para>
            /// <para>Long (large integer)— Whole numbers between -2,147,483,648 and 2,147,483,647.</para>
            /// <para>长整数（大整数）— 介于 -2,147,483,648 和 2,147,483,647 之间的整数。</para>
            /// </summary>
            [Description("Long (large integer)")]
            [GPEnumValue("LONG")]
            _LONG,

            /// <summary>
            /// <para>Date</para>
            /// <para>Date—Date and/or time.</para>
            /// <para>日期 - 日期和/或时间。</para>
            /// </summary>
            [Description("Date")]
            [GPEnumValue("DATE")]
            _DATE,

            /// <summary>
            /// <para>Blob (binary data)</para>
            /// <para>Blob (binary data)—Long sequence of binary numbers. You need a custom loader or viewer or a third-party application to load items into a BLOB field or view the contents of a BLOB field.</para>
            /// <para>Blob（二进制数据）- 二进制数的长序列。您需要自定义加载程序或查看器或第三方应用程序才能将项目加载到 BLOB 字段或查看 BLOB 字段的内容。</para>
            /// </summary>
            [Description("Blob (binary data)")]
            [GPEnumValue("BLOB")]
            _BLOB,

        }

        /// <summary>
        /// <para>Field Precision</para>
        /// <para><xdoc>
        ///   <para>The number of digits that can be stored in the field. All digits are counted regardless of which side of the decimal they are on.</para>
        ///   <para>The parameter value is only valid for numeric field types.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>字段中可以存储的位数。所有数字都被计算在内，无论它们位于小数点的哪一边。</para>
        ///   <para>参数值仅对数值字段类型有效。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Precision")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _field_precision { get; set; } = null;


        /// <summary>
        /// <para>Field Scale</para>
        /// <para>The number of decimal places stored in a field. This parameter is only used in float and double data field types.</para>
        /// <para>存储在字段中的小数位数。此参数仅用于浮点数和双精度数据字段类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Scale")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _field_scale { get; set; } = null;


        /// <summary>
        /// <para>Field Length</para>
        /// <para>The length of the field being added. This sets the maximum number of allowable characters for each record of the field. This parameter is only applicable to fields of type text.</para>
        /// <para>要添加的字段的长度。这将设置字段每条记录允许的最大字符数。此参数仅适用于文本类型的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _field_length { get; set; } = null;


        /// <summary>
        /// <para>Field Alias</para>
        /// <para>The alternate name given to the field name. This name is used to describe cryptic field names. This parameter only applies to geodatabases.</para>
        /// <para>字段名称的备用名称。此名称用于描述隐晦的字段名称。此参数仅适用于地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Alias")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_alias { get; set; } = null;


        /// <summary>
        /// <para>Field IsNullable</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the field can contain null values. Null values are different from zero or empty fields and are only supported for fields in a geodatabase.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Checked—The field will allow null values. This is the default.</bullet_item><para/>
        ///       <bullet_item>Unchecked—The field will not allow null values.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定字段是否可以包含 null 值。空值不同于零字段或空字段，并且仅对地理数据库中的字段支持。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>选中 - 该字段将允许空值。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>未选中 - 该字段不允许空值。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field IsNullable")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _field_is_nullable_value _field_is_nullable { get; set; } = _field_is_nullable_value._true;

        public enum _field_is_nullable_value
        {
            /// <summary>
            /// <para>NULLABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NULLABLE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_NULLABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_NULLABLE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Sublayer</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Sublayer")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output_layer { get; set; }


        public AddFieldToAnalysisLayer SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}